package cn.changeforyou.demo.netty.common;

import java.util.UUID;
import java.util.concurrent.atomic.AtomicLong;

/**
 * @author zhyu
 * @date 2021/3/16 13:13
 */
public class Req {

    static AtomicLong msgIdGen = new AtomicLong(0);
    public enum ReqType {
        login,
    }

    private Object data;
    private String msgId;
    private ReqType reqType;

    private Req() {
    }

    public Req(Object data, ReqType reqType) {
        this.data = data;
        this.reqType = reqType;
        msgId = UUID.randomUUID().toString();
    }

    public static AtomicLong getMsgIdGen() {
        return msgIdGen;
    }

    public Object getData() {
        return data;
    }

    public String getMsgId() {
        return msgId;
    }

    public ReqType getReqType() {
        return reqType;
    }
}
